package top.csjss.hospital.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.csjss.hospital.entity.OutPatientType;
import top.csjss.hospital.entity.Pharmacy;
import top.csjss.hospital.mapper.OutPatientTypeMapper;
import top.csjss.hospital.service.OutPatientTypeService;

import java.util.List;

/**
 * @Author ztf
 * @Date 10:16 2021/10/22
 **/
@Service
public class OutPatientTypeServiceImpl implements OutPatientTypeService {
    @Autowired
    private OutPatientTypeMapper outPatientTypeMapper;

    @Override
    public PageInfo<OutPatientType> selectProject(String projectName, Integer page, Integer limit) {
        //开启分页
        PageHelper.startPage(page, limit);
        //查询
        List<OutPatientType> outPatientTypes = outPatientTypeMapper.selectProject(projectName);
        //封装
        PageInfo<OutPatientType> pageInfo = new PageInfo<>(outPatientTypes);
        //返回
        return pageInfo;
    }

    @Override
    public Double findPriceByName(String durgname) {
        Double price = outPatientTypeMapper.findPriceByName(durgname);
        return price;
    }

    @Override
    public Integer findOstateByName(String durgname) {
        Integer ostate = outPatientTypeMapper.findOstateByName(durgname);
        return ostate;
    }
}
